import axios from './interceptor'
// 添加评论
const postComment = (
  parentId: string | null,
  uid: string,
  address: string,
  content: string,
  articleId: string,
  articleTitle: string,
  username: string,
  avatar: string,
  report: string
) => {
  return axios.post('/comment', {
    parentId,
    uid,
    address,
    content,
    articleId,
    articleTitle,
    username,
    avatar,
    report,
  })
}
// 查找
const findComment = (articleId: string) => {
  return axios.get(`/comment?articleId=${articleId}`)
}

// 删除评论
const delAllComment = (ids: string[]) => {
  return axios.post('/comment/delAll', {
    ids,
  })
}
// 举报
const reportComment = (id: string) => {
  return axios.get(`/comment/report?id=${id}`)
}
export { postComment, findComment, delAllComment, reportComment }
